
 <!--爬取模态框-->
     <div id="myModal_spider" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
              <div class="modal-dialog">
                  <div class="modal-content">
                      <div class="modal-header">
						    <h4 class="modal-title" id="myModalLabel">宠物信息爬取</h4>
						     <button class="close" data-dismiss="modal" aria-hidden="true">&times;关闭</button>
                      </div>
                      <div class="modal-body">
                          <form class="form-horizontal" id="addform" role="form" method="post" action="/catch_spyder">
							  <div class="form-group1">
							  	<label for="sid" class="col-sm-12 control-label"><a href="https://www.chongso.com/">
								爬取的宠物网站https://www.chongso.com/</a></label>
							  	<input type="hidden"  value="{{pd.page.pages}}" name="lastpage"><!-- 这里是隐藏框里面存放页数值 --尾页 -->
							  	<!-- <input type="hidden"  value="{{pd.page.page}}" name="currentpage"> --><!-- 这里是隐藏框里面存放页数值 --尾页 -->
							  </div>
                              <div class="form-group1">
                                  <select id="dropdown_spyder" name="dropdown_spyder">
                                      <option value="1">1</option>  
                                      <option value="2">2</option>  
                                      <option value="3">3</option>  
                                  	<option value="4">4</option>
                                  	<option value="5">5</option>
                                      <option value="6">6</option>
                                      <option value="7">7</option>  
                                      <option value="8">8</option>  
                                      <option value="9">9</option>
                                      <option value="10">10</option> 
                                  </select>  
                                  <button id="addBtn" type="button" class="btn btn-primary">添加输入框</button>  
                                  
                                  <div class="col-sm-9">
                                      <div id="inputGroup"></div>
                                  </div>
                              </div>
							  <script>
							  	// 定义一个函数，用于生成输入框  
							  	function createInput() {  
							  	    var input = $('<input>').addClass('form-control');  
							  	    return input;  
							  	}
							  	// 绑定事件监听器  
							  	$('#dropdown_spyder').on('change', function () {  
							  	    var selectedValue = $(this).val();  
							  	    var inputGroup = $('#inputGroup');
							  	    // 删除之前的输入框  
							  	    inputGroup.empty();
							  	    // 根据选中的值生成相应数量的输入框  
							  	    for (var i = 1; i <= selectedValue; i++) {  
							  	        var input = createInput();  
							  			input.addClass('select_input'+i.toString())
							  			input.attr('name','select_input'+i.toString())
							  	        inputGroup.append('请输入网址后缀','https://www.chongso.com/z/chongwu',input);  
							  	        if (i < selectedValue) {  
							  	            inputGroup.append('<br>');  
							  	        }  
							  	    }  
							  	});
							  	// 绑定添加输入框按钮的事件监听器  
							  	$('#addBtn').on('click', function () {  
							  	    var selectedValue = $('#dropdown_spyder').val();  
							  	    var inputGroup = $('#inputGroup');
							  	    // 删除之前的输入框  
							  	    inputGroup.empty();
							  	    // 根据选中的值生成相应数量的输入框  
							  	    for (var i = 1; i <= selectedValue; i++) {  
							  	        var input = createInput();   
										input.addClass('select_input'+i.toString())
										input.attr('name','select_input'+i.toString())
							  	        inputGroup.append('请输入网址后缀','https://www.chongso.com/z/chongwu',input);  
							  	        if (i < selectedValue) {  
							  	            inputGroup.append('<br>');  
							  	        }  
							  	    }  
							  	});  
							  </script> 
                              
							 
                              <input type="submit" value="提交" id="addbut_spider" style="display: none;">
                          </form>
                      </div>
                      <div class="modal-footer">
                          <button class="btn btn-default" data-dismiss="modal">关闭</button>
                          <button class="btn btn-primary" id="submitbut_spyder">提交</button>
                      </div>
                  </div>
              </div>
          </div>
            <!--爬取模态框结束-->
        <script>
              $(function(){
                  $("#submitbut_spyder").click(function(){
                          $("#addbut_spider").click()
                  });
              })
          </script>